package com.melesta.payment.tapjoy;

import com.melesta.payment.interfaces.IRequest;
import com.melesta.payment.interfaces.IRequestBuilder;

public class TapjoyRequestBuilder
  implements IRequestBuilder
{
  private static final String ACTION_TAG = "action";
  private static final String CURRENCY_TAG = "currency";
  private static final String IGNORE_ERRORS_TAG = "ignoreErrors";
  private static final String NAME_TAG = "name";
  private TapjoyAction action;
  private String currencyName;
  private boolean ignoreErrors;
  private String name;
  private TapjoySystem system;

  public TapjoyRequestBuilder(TapjoySystem paramTapjoySystem)
  {
    this.system = paramTapjoySystem;
  }

  public IRequest createRequest()
  {
    switch (1.$SwitchMap$com$melesta$payment$tapjoy$TapjoyRequestBuilder$TapjoyAction[this.action.ordinal()])
    {
    default:
      return null;
    case 1:
      return new TapjoyOffersRequest(this.system).setName(this.name).setCurrencyName(this.currencyName);
    case 2:
      return new TapjoyListenerRequest(this.system).setName(this.name).setCurrencyName(this.currencyName);
    case 3:
    }
    return new TapjoyRefreshRequest(this.system).setIgnoreErrors(this.ignoreErrors).setName(this.name).setCurrencyName(this.currencyName);
  }

  public Object get(String paramString)
  {
    if (paramString.equals("action"))
      return this.action;
    if (paramString.equals("name"))
      return this.name;
    if (paramString.equals("currency"))
      return this.currencyName;
    if (paramString.equals("ignoreErrors"))
      return new Boolean(this.ignoreErrors);
    return null;
  }

  public TapjoyRequestBuilder set(String paramString, Object paramObject)
  {
    if (paramString.equals("action"))
    {
      this.action = TapjoyAction.getAction(paramObject.toString());
      if (this.action == null)
        throw new IllegalArgumentException("Action: " + paramObject.toString());
    }
    else
    {
      if (!paramString.equals("name"))
        break label76;
      this.name = paramObject.toString();
    }
    label76: 
    do
    {
      return this;
      if (paramString.equals("currency"))
      {
        this.currencyName = paramObject.toString();
        return this;
      }
    }
    while (!paramString.equals("ignoreErrors"));
    this.ignoreErrors = Boolean.parseBoolean(paramObject.toString());
    return this;
  }

  public static enum TapjoyAction
  {
    private String alias;

    static
    {
      LISTENER = new TapjoyAction("LISTENER", 1, "listener");
      REFRESH = new TapjoyAction("REFRESH", 2, "refresh");
      TapjoyAction[] arrayOfTapjoyAction = new TapjoyAction[3];
      arrayOfTapjoyAction[0] = OFFERS;
      arrayOfTapjoyAction[1] = LISTENER;
      arrayOfTapjoyAction[2] = REFRESH;
    }

    private TapjoyAction(String paramString)
    {
      this.alias = paramString;
    }

    public static TapjoyAction getAction(String paramString)
    {
      for (TapjoyAction localTapjoyAction : values())
        if (localTapjoyAction.alias.equals(paramString))
          return localTapjoyAction;
      return null;
    }
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.melesta.payment.tapjoy.TapjoyRequestBuilder
 * JD-Core Version:    0.6.2
 */